import { useMenus } from '@/pinia/menus.js'

export function usePermission(pageName, hanldeName) {//pageName操作页面   hanldeName操作权限
  const store = useMenus()
  const permissions = store.permissions
  const verifyPermission = `system:${pageName}:${hanldeName}`

  // name = "coderwhy"
  // !name -> false
  // !!name -> true
  return !!permissions.find((item) => item === verifyPermission)
}
